/*
Date:20220317 20:23PM
key:当sum==target,r++不要忘记。
*/
class Solution {
public:
    vector<vector<int>> findContinuousSequence(int target) {
        vector<vector<int>>result;
        int l=1,r=2,sum=3;
        while(l<r&&r<target)
        {
            //cout<<r<<" ";
            if(sum==target)
            {
                int size=r-l+1;
                vector<int>tmp;
                tmp.resize(size);
                for(int j=l;j<=r;j++)
                {
                    tmp[j-l]=j;
                }
                result.push_back(tmp);
                r++;
                    sum+=r;
            }
            else
            {
                if(sum>target)
                {
                    sum-=l;
                    l++;
                    
                }
                else
                {
                    
                    r++;
                    sum+=r;
                }
            }
        }
        return result;
    }
};